package com.onehouse.api.dto;

import com.onehouse.api.vo.RoomPriceVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DailyRoomPriceSetDTO {
    
    private LocalDate date;
    private List<RoomPriceVO> roomPrices;
    
    public void addRoomPrice(RoomPriceVO roomPrice) {
        roomPrices.add(roomPrice);
    }
    
    public RoomPriceVO getRoomPriceByTypeId(Long roomTypeId) {
        return roomPrices.stream()
                .filter(price -> price.getRoomTypeId().equals(roomTypeId))
                .findFirst()
                .orElse(null);
    }
}